#!/bin/bash

java_cmd="/usr/bin/java"

stop()
{
    PID=`ps ax | grep sconsumer | grep java | head -1 | awk '{print $1}'`
    if [ -n "$PID" ];then
        kill $PID
        echo "killing ..."
        sleep 1s
        echo "killed $PID"
    fi
}

stop